package vim.meet.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

@Service
public class ContextUtils implements ApplicationContextAware {
	
	private static final Logger logger = LoggerFactory.getLogger(ContextUtils.class);
	
	private ApplicationContext context;

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.context = applicationContext;
		
		String[] names = applicationContext.getBeanDefinitionNames();
		for(String name:names)
			logger.debug(name);
		logger.info("log class:"+logger.getClass().getName());

	}

	public ApplicationContext getContext() {
		return context;
	}

	public void setContext(ApplicationContext context) {
		this.context = context;
	}
	
	

}
